package com.wc.emu;

import java.util.Locale;

/**
 * @ClassName:Role
 * @Author: 鹿建文
 * @Date: 2022/3/21  - 14:37
 * @Describe:
 */
public enum Role {

    ADMIN,
    COMMON,
    VIP
    ;

    /**
     * 将字符串转换成对应的Role类型
     * @param role
     * @return
     */
     public  static  Role getRole(String role){
          role = role.toLowerCase();
          switch (role){
              case "admin":
                  return Role.ADMIN;

              case "vip":
                  return  Role.VIP;
              case "comm":
                  return  Role.COMMON;
              default:
                  return null;
          }
     }
}
